<template>
    <div class='selectClassify'>
        <div class="boxin">
            <div class="boxl">
                <div class="txt txt1">
                    <p class="title">选择分类</p>
                </div>
            </div>
            <div class="boxr">
                <el-form ref="form" :model="form" :rules="rules" label-width="200px" v-loading="loading">
                    <el-col :span="24">
                        <el-col :span="12">
                            <el-form-item label="您最近使用的商品分类" prop="name">
                                <el-input v-if="edit" v-model="form.name" placeholder="请输入您最近使用的商品分类" />
                                <span v-else>{{ form.name }}</span>
                            </el-form-item>
                        </el-col>
                    </el-col>
                </el-form>
                <div class="button">
                    <el-button type="primary" @click="submit">下一步，填写商品信息</el-button>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'selectClassify',
    components: {

    },
    data() {
        return {
            loading: false,
            edit: true,
            form: {

            },
            rules: {
                name: [{ required: true, message: '请输入商品分类', trigger: 'blur' }],
            },
        }
    },
    created() {
        this.edit = this.type == "detail" ? false : true
    },
    methods: {
        submit() {
            this.$refs.form.validate((valid) => {
                if (valid) {
                    this.$emit('next')
                }
            })
        }
    },
}

</script>
<style scoped lang='scss'>
</style>